<meta charset="utf-8">
<div class="map"></div>
<button class="start">开始</button>
<button class="stop">停止</button>
<script src="./map.js"></script>
<script src="./game.js"></script>
<script src="./food.js"></script>
<script src="./snake.js"></script>
<script>
    const g = new Game('.map')
    // 点击开始让蛇移动
    const start = document.querySelector('.start')
    start.addEventListener('click', () => { g.start() })
    const stop = document.querySelector('.stop')
    stop.addEventListener('click', () => { g.stop() })
</script>